*** Settings ***
Documentation           SSH连接关键库
Resource                ../resource.robot
Library                 test_ssh_msg.py

*** Keywords ***
Connect To BMC SSH
    [Documentation]    建立SSH连接
    ${ssh}=    Try Connect SSH    ${OPENUBMC_HOST}  ${SSH_PORT}  ${OPENUBMC_USERNAME}  ${OPENUBMC_PASSWORD}

    RETURN    ${ssh}

Execute SSH Command
    [Documentation]    执行SSH命令
    [Arguments]    ${ssh}    ${command}
    ${rsp}=    Send Ssh Msg    ${ssh}    ${command}
    RETURN    ${rsp}

Close SSH Session
    [Documentation]    关闭SSH连接
    [Arguments]    ${ssh}
    Close SSH Connection    ${ssh}

Open SSH Connection
    [Documentation]    验证ssh连接是否正常
    ${ssh}=    Connect To BMC SSH
    Should Not Be Equal    ${ssh}    ${None}    msg=SSH连接失败
    Set Suite Variable    ${ssh}